package com.kedacom.ctsp.authz.oauth2.client.service;

import com.kedacom.ctsp.authz.oauth2.core.vo.AccessToken;
import com.kedacom.ctsp.web.controller.message.ResponseMessage;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * oauth2 feign客户端
 *
 * @author xuwei
 * @create 2018-05-16 18:51
 **/
@FeignClient(name = "accessToken", url = "${commons.oauth2.client.serverInUri}")
public interface OAuth2AccessTokenService {

    @RequestMapping(method = RequestMethod.POST, value = "/access_token")
    ResponseMessage<AccessToken> requestToken(@RequestParam("grant_type") String grantType, @RequestParam("client_id") String clientId, @RequestParam("client_secret") String clientSecret, @RequestParam("redirect_uri") String redirectUri, @RequestParam("code") String code,@RequestParam("username") String username,@RequestParam("password") String password,@RequestParam("refreshToken") String refreshToken);

}
